Optimal. Leaf size=100 \[ \frac {x}{2}-\frac {\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a+\frac {b^2}{2 c}\right )}{4 \sqrt {c}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3531, 3529,
3433, 3432} \begin {gather*} -\frac {\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b-2 c x}{\sqrt {\pi } \sqrt {c}}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } \sin \left (2 a+\frac {b^2}{2 c}\right ) S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}+\frac {x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3432
Rule 3433
Rule 3529
Rule 3531
Rubi steps
\begin {align*} \int \cos ^2\left (a+b x-c x^2\right ) \, dx &=\int \left (\frac {1}{2}+\frac {1}{2} \cos \left (2 a+2 b x-2 c x^2\right )\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \int \cos \left (2 a+2 b x-2 c x^2\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \cos \left (2 a+\frac {b^2}{2 c}\right ) \int \cos \left (\frac {(2 b-4 c x)^2}{8 c}\right ) \, dx+\frac {1}{2} \sin \left (2 a+\frac {b^2}{2 c}\right ) \int \sin \left (\frac {(2 b-4 c x)^2}{8 c}\right ) \, dx\\ &=\frac {x}{2}-\frac {\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) C\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } S\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a+\frac {b^2}{2 c}\right )}{4 \sqrt {c}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 100, normalized size = 1.00 \begin {gather*} \frac {2 \sqrt {c} x+\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {-b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )+\sqrt {\pi } S\left (\frac {-b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a+\frac {b^2}{2 c}\right )}{4 \sqrt {c}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 76, normalized size = 0.76
method | result | size |
default | \(\frac {x}{2}+\frac {\sqrt {\pi }\, \left (\cos \left (\frac {4 a c +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {4 a c +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 \sqrt {c}}\) | \(76\) |
risch | \(\frac {x}{2}+\frac {\sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c +b^{2}\right )}{2 c}} \erf \left (\sqrt {-2 i c}\, x +\frac {i b}{\sqrt {-2 i c}}\right )}{8 \sqrt {-2 i c}}-\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c +b^{2}\right )}{2 c}} \sqrt {2}\, \erf \left (-\sqrt {2}\, \sqrt {i c}\, x +\frac {i b \sqrt {2}}{2 \sqrt {i c}}\right )}{16 \sqrt {i c}}\) | \(107\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.52, size = 124, normalized size = 1.24 \begin {gather*} \frac {4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i - 1\right ) \, \cos \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) + \left (i + 1\right ) \, \sin \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x - i \, b}{\sqrt {2 i \, c}}\right ) + {\left (-\left (i + 1\right ) \, \cos \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) + \left (i - 1\right ) \, \sin \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x - i \, b}{\sqrt {-2 i \, c}}\right )\right )} c^{\frac {3}{2}} + 16 \, c^{2} x}{32 \, c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.46, size = 96, normalized size = 0.96 \begin {gather*} \frac {\pi \sqrt {\frac {c}{\pi }} \cos \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) \operatorname {C}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) + \pi \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) \sin \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) + 2 \, c x}{4 \, c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.54, size = 88, normalized size = 0.88 \begin {gather*} \frac {x}{2} + \frac {\sqrt {\pi } \sqrt {- \frac {1}{c}} \left (- \sin {\left (2 a + \frac {b^{2}}{2 c} \right )} S\left (\frac {2 b - 4 c x}{2 \sqrt {\pi } \sqrt {- c}}\right ) + \cos {\left (2 a + \frac {b^{2}}{2 c} \right )} C\left (\frac {2 b - 4 c x}{2 \sqrt {\pi } \sqrt {- c}}\right )\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.50, size = 124, normalized size = 1.24 \begin {gather*} \frac {1}{2} \, x - \frac {\sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - \frac {\sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\cos \left (-c\,x^2+b\,x+a\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________